package com.company.project.service.impl;

import com.company.project.core.Result;
import com.company.project.core.ResultGenerator;
import com.company.project.dao.VtManagerMapper;
import com.company.project.model.VtManager;
import com.company.project.service.LoginService;
import com.company.project.service.VtManagerService;
import org.apache.juli.logging.Log;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class LoginServiceImpl implements LoginService {
    @Resource
    private VtManagerMapper vtManagerMapper;
    @Override
    public Result login(String userName, String passWord) {
        VtManager vtManager = new VtManager();
        vtManager.setUsername(userName);
        vtManager = vtManagerMapper.selectOne(vtManager);
        return ResultGenerator.genSuccessResult(vtManager);
    }

    @Override
    public VtManager getUser(String userName, String passWord) {
        VtManager vtManager = new VtManager();
        vtManager.setUsername(userName);
        vtManager = vtManagerMapper.selectOne(vtManager);
        return vtManager;
    }

    //    @Resource
//    private UserMapper userMapper;
//
//    public Result login(String userName, String passWord) {
//        User user = userMapper.selectByPrimaryKey(userName);
//        user.add
//    }
}